<?php

/**
 * define agilet constant for security checking
 */
define('AGILET', 1);

/**
 * define start time for security
 */
define('START_TIME', microtime(1));

/**
 * define start memory for profiling
 */
define('START_MEMORY', memory_get_usage());

/**
 * define application root path
 */
define('ROOT_PATH', realpath(__DIR__ . '/..'));

/**
 * define application path
 */
define('APP_PATH', ROOT_PATH . '/application');

/**
 * define library path
 */
define('LIBRARY_PATH', ROOT_PATH . '/library');

/**
 * define temporary path
 */
define('TEMP_PATH', ROOT_PATH . '/temporary');

/**
 * define template path
 */
define('LAYOUT_PATH', ROOT_PATH . '/application/template');

/**
 * define production stage
 */
define('APP_ENV', 'production');

/**
 * define configuration mode
 */
define('CONFIG_PATH', APP_PATH . '/config/development');

/**
 * define static resource path
 */
define('STATIC_PATH', ROOT_PATH . '/static');

/**
 * define E_FALTAL MODE, IF error code match E_FATAL, application will exit
 */
define('E_FATAL', E_ERROR | E_USER_ERROR | E_PARSE | E_CORE_ERROR | E_COMPILE_ERROR | E_RECOVERABLE_ERROR);

/**
 * set defaut time zone for date() method
 */
date_default_timezone_set('UTC');

/**
 * remove this code on production mode
 */
ini_set('display_startup_errors', 1);
ini_set('display_errors',1);
ini_set('error_reporting', E_ALL);

/**
 * reset include path
 */
set_include_path(implode(PATH_SEPARATOR, array(
	LIBRARY_PATH,
	get_include_path()
)));

// Utility

require_once 'functions.php';
require_once 'classes/system/agilet.php';

Agilet::__bootstrap();
